/* 搜索页面样式 */
.search-page {
    min-height: 100vh;
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* 搜索头部 */
.search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    width: 100%;
}

.search-header-left {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 12px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.search-input-container {
    flex: 1;
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.search-input {
    width: 100%;
    max-width: 100%;
    height: 44px;
    border: none;
    border-radius: 22px;
    padding: 0 50px 0 20px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.clear-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 搜索类型选择 */
.search-types {
    background: white;
    padding: 16px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    border-bottom: 1px solid #eee;
}

.search-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    white-space: nowrap;
}

.search-type-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.search-type-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.type-icon {
    font-size: 20px;
}

.type-label {
    font-size: 12px;
    font-weight: 500;
}

/* 搜索内容区域 */
.search-content {
    padding: 16px;
}

/* 搜索建议 */
.search-suggestions {
    max-width: 600px;
    margin: 0 auto;
}

.search-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.clear-history-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    background: #f5f5f5;
    color: #666;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-item {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    overflow: hidden;
}

.history-text {
    background: transparent;
    border: none;
    padding: 8px 10px 8px 14px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
}

.history-text:hover {
    color: #334155;
}

.history-delete {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
}

.history-delete:hover {
    color: #ef4444;
}

.search-tag {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-tag:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 搜索结果 */
.search-results {
    max-width: 800px;
    margin: 0 auto;
}

.loading-state,
.error-state,
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.loading-spinner {
    font-size: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.error-icon,
.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.loading-state p,
.error-state p,
.no-results p {
    color: #666;
    margin: 8px 0 20px 0;
}

.retry-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 结果列表 */
.results-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.results-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.results-count {
    color: #666;
    font-size: 14px;
}

.results-list {
    padding: 0;
}

.result-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    gap: 16px;
    height: 300px;
    box-sizing: border-box;
}

.result-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.result-item:last-child {
    border-bottom: none;
}

.doctor-avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.default-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.doctor-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.doctor-name {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex-wrap: wrap;
    min-height: 28px;
}

.doctor-title {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.doctor-hospital {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.4;
    min-height: 20px;
}

.doctor-expertise {
    color: #333;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
    min-height: 60px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.doctor-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    flex-wrap: wrap;
    line-height: 1.4;
    margin-top: auto;
    padding-top: 16px;
}

.separator {
    color: #ddd;
}

.rating {
    color: #ff6b6b;
    font-weight: 500;
}

.views {
    color: #4ecdc4;
}

.price {
    color: #ffa726;
    font-weight: 500;
}

.result-arrow {
    color: #ccc;
    font-size: 20px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    align-self: center;
}

.result-item:hover .result-arrow {
    color: #667eea;
    transform: translateX(4px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-header {
        padding: 16px 12px;
    }

    .search-types {
        padding: 12px;
        gap: 8px;
    }

    .search-type-btn {
        min-width: 70px;
        padding: 10px 12px;
    }

    .search-content {
        padding: 12px;
    }

    .result-item {
        padding: 16px;
        gap: 12px;
        height: 280px;
    }

    .doctor-avatar {
        margin-right: 0;
    }

    .avatar-img,
    .default-avatar {
        width: 50px;
        height: 50px;
    }

    .doctor-name {
        font-size: 16px;
    }

    .doctor-title {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .search-header {
        padding: 16px 8px;
    }

    .search-header-left {
        gap: 8px;
    }

    .back-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .search-input {
        height: 40px;
        font-size: 14px;
        padding: 0 45px 0 16px;
    }

    .search-btn {
        font-size: 16px;
        padding: 6px;
    }

    .clear-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}